#include "node/sequence_task_node.h"

namespace project_template {
SequenceTaskNode::SequenceTaskNode() { init(); }

SequenceTaskNode::~SequenceTaskNode() {
  if (ros::isStarted()) {
    ros::shutdown();
    ros::waitForShutdown();
  }
  wait();
}

bool SequenceTaskNode::init() {
  ros::NodeHandle nh;

  if (!ros::master::check()) {
    return false;
  }
  start();

  return true;
}

void SequenceTaskNode::run() {
  // 核心处理函数
  ros::Rate rate(50);

  while (ros::ok()) {
    ros::spinOnce();
    rate.sleep();
  }
  emit rosShutdown();
  quit();
}

}  // namespace project_template
